/**
 * @author: yangwk
 * @date: 2023/8/7
 * @description:
 **/
public class 左移右移 {
    public static void main(String[] args) {
        System.out.println(Integer.toBinaryString(-2));
        System.out.println(-2 >> 2);
        System.out.println(Integer.toBinaryString(-2 << 2));
        System.out.println(Integer.toBinaryString(-2 >> 2));
        int a = -1, count = 0;
        while (a != 0) {
            count += a & 1;
             a >>>= 1;
        }
        System.out.println(Integer.MAX_VALUE + 1);
        System.out.println(count);

    }
}
